<?php

/**
 * Description of paymentTest
 *
 * @author hutengjiao
 */
require_once 'BaseChannel.php';

class shzmTest implements BaseChannel{
	function __construct(){
		
	}
	function android($data){
		$ret = $this->paymentTest(ANDROID);
		echo $ret;
	}
	function ios($data){
		$ret = $this->paymentTest(IOS);
		echo $ret;
	}
	function paymentTest($platform){
		echo 'cp_id is '.$_POST['cp_id'].' and server_id is '.$_POST['server_id'].' and bill_no is '.$_POST['bill_no'].' and money is '.$_POST['money'].' and user_id is '.$_POST['user_id'].
		' and trade_atatus is '.$_POST['trade_status'].' and sign is '.$_POST['sign'].' and cp_bill_no is '.$_POST['cp_bill_no'].' and extra is '.$_POST['extra'];
		
		$orderTest = new ChargeOrder();
		$orderTest->log("shzmTest", $_POST);
		if(false == $orderTest->recordOrder(STATUS_SUCCESS, $_POST['money'], $_POST['cp_bill_no'], "shzmTest", $platform, $_POST['bill_no']))
		{
			$ret = "failure";
			$orderTest->log("shzmTest", array("order"=>$_POST['cp_bill_no'], "money"=>$_POST['money'], "result"=>$ret, "serverresult"=>"failed"));
		}else
		{
			$ret = "success";
			$orderTest->log("shzmTest", array("order"=>$_POST['cp_bill_no'], "money"=>$_POST['money'], "result"=>$ret, "serverresult"=>"success"));
		}
		return $ret;
	}
}
?>